package com.anttribe.components.db.metadata.utils;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @author zhaoyong
 * @date 2020-12-29
 */
public final class DbUtils {

    /**
     * 关闭数据库链接
     *
     * @param conn
     * @throws SQLException
     */
    public static void close(Connection conn) throws SQLException {
        if (conn != null) {
            conn.close();
        }
    }

    /**
     * 关闭ResultSet资源
     *
     * @param rs
     * @throws SQLException
     */
    public static void closeQuietly(ResultSet rs) throws SQLException {
        if (null != rs) {
            rs.close();
        }
    }

}
